#ifndef __qyfilesystembrowser__
#define __qyfilesystembrowser__

#include <QWidget>
#include <QFileInfo>

class QDirModel;
class QTreeView;
class QLineEdit;
class QModelIndex;
class QComboBox;

class QyFileSystemBrowser : public QWidget {
	Q_OBJECT
public:
	QyFileSystemBrowser( QWidget * parent=0 );

	QString currentPath() const;
	QString currentFileName() const;
	QString currentFilePath() const;
	QFileInfo currentFileInfo() const;
	QStringList defaultNamefilters() const { return p_defaultNamefilters; }

public slots:
	void setPath( const QString & path );
	void cdUp();
	void setDefaultNameFilters( QStringList nameFilters );

signals:
	void activated( const QString & filePath );

private slots:
	void on_treeView_doubleClicked( const QModelIndex & modelIndex );
	void on_pathEdit_textChanged( const QString & path );
	void on_filterEditBox_editTextChanged( const QString & text );
	void returnPressed();
	void setPathEditFocus();
	void setFilterEditFocus();

private:
    QDirModel * dirModel;
    QTreeView * treeView;
	QLineEdit * pathEdit;
	QComboBox * filterEditBox;
	QStringList p_defaultNamefilters;

};

#endif/*__qyfilesystembrowser__*/
